#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<unordered_set>
#include<unordered_map>
#include<numeric>
#include<queue>
#include<iomanip>
#define no "No\n"
#define yes "Yes\n"
#define int long long 
#define INPUT "calc.in"
#define OUTPUT "calc.out"
using namespace std;
signed main() {
#if not defined TEST
    freopen(INPUT, "r", stdin);
    freopen(OUTPUT, "w", stdout);
#endif
    string s;
    cin >> s;
    int cnt = 0;
    for (int i = 0; i < s.size()-1; i++) {
        if (s[i] == '0' && s[i + 1] == '0') {
            i++;
        }
        cnt++;
    }
    if (s.back() != 0)cnt++;
    cout << cnt;
#if not defined TEST
    fclose(stdin);
    fclose(stdout);
#endif
    return 0;
}


